package com.cx.mall.api.goods;

//import com.cx.mall.api.impl.SkuInfoFeignImpl;
import com.cx.mall.common.model.goods.Product;
import com.cx.mall.common.utils.ResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

//fallback = 还有一个工厂模式，可以做一个工厂来作为大量不同错误数据的兜底返回数据
@FeignClient(contextId = "product", name = "mall-goods-service")//,fallback = SkuInfoFeignImpl.class
public interface ProductFeign {
    @GetMapping("/goods/product/list")  // 要写全的路径
    public ResponseVO page(@SpringQueryMap Product product);

    /**
     * 按商品ID获取商品详情
     * @param id
     * @return
     */
    @GetMapping("/goods/product/{id}")
    ResponseVO getById(@PathVariable("id") Long id);

    }
